(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

cond1(true, x, y, z) → cond2(gr(x, 0), x, y, z)
cond2(true, x, y, z) → cond1(gr(add(x, y), z), p(x), y, z)
cond2(false, x, y, z) → cond3(gr(y, 0), x, y, z)
cond3(true, x, y, z) → cond1(gr(add(x, y), z), x, p(y), z)
cond3(false, x, y, z) → cond1(gr(add(x, y), z), x, y, z)
gr(0, x) → false
gr(s(x), 0) → true
gr(s(x), s(y)) → gr(x, y)
add(0, x) → x
add(s(x), y) → s(add(x, y))
p(0) → 0
p(s(x)) → x

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

cond1(true, x, y, z) → cond2(gr(x, 0), x, y, z) [1]
cond2(true, x, y, z) → cond1(gr(add(x, y), z), p(x), y, z) [1]
cond2(false, x, y, z) → cond3(gr(y, 0), x, y, z) [1]
cond3(true, x, y, z) → cond1(gr(add(x, y), z), x, p(y), z) [1]
cond3(false, x, y, z) → cond1(gr(add(x, y), z), x, y, z) [1]
gr(0, x) → false [1]
gr(s(x), 0) → true [1]
gr(s(x), s(y)) → gr(x, y) [1]
add(0, x) → x [1]
add(s(x), y) → s(add(x, y)) [1]
p(0) → 0 [1]
p(s(x)) → x [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

cond1(true, x, y, z) → cond2(gr(x, 0), x, y, z) [1]
cond2(true, x, y, z) → cond1(gr(add(x, y), z), p(x), y, z) [1]
cond2(false, x, y, z) → cond3(gr(y, 0), x, y, z) [1]
cond3(true, x, y, z) → cond1(gr(add(x, y), z), x, p(y), z) [1]
cond3(false, x, y, z) → cond1(gr(add(x, y), z), x, y, z) [1]
gr(0, x) → false [1]
gr(s(x), 0) → true [1]
gr(s(x), s(y)) → gr(x, y) [1]
add(0, x) → x [1]
add(s(x), y) → s(add(x, y)) [1]
p(0) → 0 [1]
p(s(x)) → x [1]

The TRS has the following type information:
cond1 :: true:false → 0:s → 0:s → 0:s → cond1:cond2:cond3
true :: true:false
cond2 :: true:false → 0:s → 0:s → 0:s → cond1:cond2:cond3
gr :: 0:s → 0:s → true:false
0 :: 0:s
add :: 0:s → 0:s → 0:s
p :: 0:s → 0:s
false :: true:false
cond3 :: true:false → 0:s → 0:s → 0:s → cond1:cond2:cond3
s :: 0:s → 0:s

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:

cond1(v0, v1, v2, v3) → null_cond1 [0]

And the following fresh constants:

null_cond1

(6) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

cond1(true, x, y, z) → cond2(gr(x, 0), x, y, z) [1]
cond2(true, x, y, z) → cond1(gr(add(x, y), z), p(x), y, z) [1]
cond2(false, x, y, z) → cond3(gr(y, 0), x, y, z) [1]
cond3(true, x, y, z) → cond1(gr(add(x, y), z), x, p(y), z) [1]
cond3(false, x, y, z) → cond1(gr(add(x, y), z), x, y, z) [1]
gr(0, x) → false [1]
gr(s(x), 0) → true [1]
gr(s(x), s(y)) → gr(x, y) [1]
add(0, x) → x [1]
add(s(x), y) → s(add(x, y)) [1]
p(0) → 0 [1]
p(s(x)) → x [1]
cond1(v0, v1, v2, v3) → null_cond1 [0]

The TRS has the following type information:
cond1 :: true:false → 0:s → 0:s → 0:s → null_cond1
true :: true:false
cond2 :: true:false → 0:s → 0:s → 0:s → null_cond1
gr :: 0:s → 0:s → true:false
0 :: 0:s
add :: 0:s → 0:s → 0:s
p :: 0:s → 0:s
false :: true:false
cond3 :: true:false → 0:s → 0:s → 0:s → null_cond1
s :: 0:s → 0:s
null_cond1 :: null_cond1

Rewrite Strategy: INNERMOST

(7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

true => 1
0 => 0
false => 0
null_cond1 => 0

(8) Obligation:

Complexity RNTS consisting of the following rules:

add(z', z'') -{ 1 }→ x :|: x >= 0, z'' = x, z' = 0
add(z', z'') -{ 1 }→ 1 + add(x, y) :|: z' = 1 + x, z'' = y, x >= 0, y >= 0
cond1(z', z'', z1, z2) -{ 1 }→ cond2(gr(x, 0), x, y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1
cond1(z', z'', z1, z2) -{ 0 }→ 0 :|: z2 = v3, v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, v3 >= 0, z' = v0
cond2(z', z'', z1, z2) -{ 1 }→ cond3(gr(y, 0), x, y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 0
cond2(z', z'', z1, z2) -{ 1 }→ cond1(gr(add(x, y), z), p(x), y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1
cond3(z', z'', z1, z2) -{ 1 }→ cond1(gr(add(x, y), z), x, y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 0
cond3(z', z'', z1, z2) -{ 1 }→ cond1(gr(add(x, y), z), x, p(y), z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1
gr(z', z'') -{ 1 }→ gr(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y
gr(z', z'') -{ 1 }→ 1 :|: z'' = 0, z' = 1 + x, x >= 0
gr(z', z'') -{ 1 }→ 0 :|: x >= 0, z'' = x, z' = 0
p(z') -{ 1 }→ x :|: z' = 1 + x, x >= 0
p(z') -{ 1 }→ 0 :|: z' = 0

Only complete derivations are relevant for the runtime complexity.

(9) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V, V1, V2, V3),0,[cond1(V, V1, V2, V3, Out)],[V >= 0,V1 >= 0,V2 >= 0,V3 >= 0]).
eq(start(V, V1, V2, V3),0,[cond2(V, V1, V2, V3, Out)],[V >= 0,V1 >= 0,V2 >= 0,V3 >= 0]).
eq(start(V, V1, V2, V3),0,[cond3(V, V1, V2, V3, Out)],[V >= 0,V1 >= 0,V2 >= 0,V3 >= 0]).
eq(start(V, V1, V2, V3),0,[gr(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1, V2, V3),0,[add(V, V1, Out)],[V >= 0,V1 >= 0]).
eq(start(V, V1, V2, V3),0,[p(V, Out)],[V >= 0]).
eq(cond1(V, V1, V2, V3, Out),1,[gr(V4, 0, Ret0),cond2(Ret0, V4, V5, V6, Ret)],[Out = Ret,V2 = V5,V6 >= 0,V3 = V6,V4 >= 0,V5 >= 0,V1 = V4,V = 1]).
eq(cond2(V, V1, V2, V3, Out),1,[add(V7, V8, Ret00),gr(Ret00, V9, Ret01),p(V7, Ret1),cond1(Ret01, Ret1, V8, V9, Ret2)],[Out = Ret2,V2 = V8,V9 >= 0,V3 = V9,V7 >= 0,V8 >= 0,V1 = V7,V = 1]).
eq(cond2(V, V1, V2, V3, Out),1,[gr(V10, 0, Ret02),cond3(Ret02, V11, V10, V12, Ret3)],[Out = Ret3,V2 = V10,V12 >= 0,V3 = V12,V11 >= 0,V10 >= 0,V1 = V11,V = 0]).
eq(cond3(V, V1, V2, V3, Out),1,[add(V13, V14, Ret001),gr(Ret001, V15, Ret03),p(V14, Ret21),cond1(Ret03, V13, Ret21, V15, Ret4)],[Out = Ret4,V2 = V14,V15 >= 0,V3 = V15,V13 >= 0,V14 >= 0,V1 = V13,V = 1]).
eq(cond3(V, V1, V2, V3, Out),1,[add(V16, V17, Ret002),gr(Ret002, V18, Ret04),cond1(Ret04, V16, V17, V18, Ret5)],[Out = Ret5,V2 = V17,V18 >= 0,V3 = V18,V16 >= 0,V17 >= 0,V1 = V16,V = 0]).
eq(gr(V, V1, Out),1,[],[Out = 0,V19 >= 0,V1 = V19,V = 0]).
eq(gr(V, V1, Out),1,[],[Out = 1,V1 = 0,V = 1 + V20,V20 >= 0]).
eq(gr(V, V1, Out),1,[gr(V21, V22, Ret6)],[Out = Ret6,V = 1 + V21,V21 >= 0,V22 >= 0,V1 = 1 + V22]).
eq(add(V, V1, Out),1,[],[Out = V23,V23 >= 0,V1 = V23,V = 0]).
eq(add(V, V1, Out),1,[add(V24, V25, Ret11)],[Out = 1 + Ret11,V = 1 + V24,V1 = V25,V24 >= 0,V25 >= 0]).
eq(p(V, Out),1,[],[Out = 0,V = 0]).
eq(p(V, Out),1,[],[Out = V26,V = 1 + V26,V26 >= 0]).
eq(cond1(V, V1, V2, V3, Out),0,[],[Out = 0,V3 = V27,V28 >= 0,V2 = V29,V30 >= 0,V1 = V30,V29 >= 0,V27 >= 0,V = V28]).
input_output_vars(cond1(V,V1,V2,V3,Out),[V,V1,V2,V3],[Out]).
input_output_vars(cond2(V,V1,V2,V3,Out),[V,V1,V2,V3],[Out]).
input_output_vars(cond3(V,V1,V2,V3,Out),[V,V1,V2,V3],[Out]).
input_output_vars(gr(V,V1,Out),[V,V1],[Out]).
input_output_vars(add(V,V1,Out),[V,V1],[Out]).
input_output_vars(p(V,Out),[V],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. recursive : [add/3]
1. recursive : [gr/3]
2. non_recursive : [p/2]
3. recursive : [cond1/5,cond2/5,cond3/5]
4. non_recursive : [start/4]

#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into add/3
1. SCC is partially evaluated into gr/3
2. SCC is partially evaluated into p/2
3. SCC is partially evaluated into cond1/5
4. SCC is partially evaluated into start/4

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations add/3
* CE 12 is refined into CE [22]
* CE 11 is refined into CE [23]


### Cost equations --> "Loop" of add/3
* CEs [23] --> Loop 13
* CEs [22] --> Loop 14

### Ranking functions of CR add(V,V1,Out)
* RF of phase [14]: [V]

#### Partial ranking functions of CR add(V,V1,Out)
* Partial RF of phase [14]:
- RF of loop [14:1]:
V


### Specialization of cost equations gr/3
* CE 15 is refined into CE [24]
* CE 14 is refined into CE [25]
* CE 13 is refined into CE [26]


### Cost equations --> "Loop" of gr/3
* CEs [25] --> Loop 15
* CEs [26] --> Loop 16
* CEs [24] --> Loop 17

### Ranking functions of CR gr(V,V1,Out)
* RF of phase [17]: [V,V1]

#### Partial ranking functions of CR gr(V,V1,Out)
* Partial RF of phase [17]:
- RF of loop [17:1]:
V
V1


### Specialization of cost equations p/2
* CE 17 is refined into CE [27]
* CE 16 is refined into CE [28]


### Cost equations --> "Loop" of p/2
* CEs [27] --> Loop 18
* CEs [28] --> Loop 19

### Ranking functions of CR p(V,Out)

#### Partial ranking functions of CR p(V,Out)


### Specialization of cost equations cond1/5
* CE 21 is refined into CE [29]
* CE 18 is refined into CE [30,31,32]
* CE 19 is refined into CE [33,34,35]
* CE 20 is refined into CE [36]


### Cost equations --> "Loop" of cond1/5
* CEs [32] --> Loop 20
* CEs [31] --> Loop 21
* CEs [30] --> Loop 22
* CEs [35] --> Loop 23
* CEs [34] --> Loop 24
* CEs [33] --> Loop 25
* CEs [36] --> Loop 26
* CEs [29] --> Loop 27

### Ranking functions of CR cond1(V,V1,V2,V3,Out)
* RF of phase [20]: [V1,V1+V2-1,V1+V2-V3]
* RF of phase [22]: [V1]
* RF of phase [23]: [V2-1,V2-V3]
* RF of phase [25]: [V2]

#### Partial ranking functions of CR cond1(V,V1,V2,V3,Out)
* Partial RF of phase [20]:
- RF of loop [20:1]:
V1
V1+V2-1
V1+V2-V3
* Partial RF of phase [22]:
- RF of loop [22:1]:
V1
* Partial RF of phase [23]:
- RF of loop [23:1]:
V2-1
V2-V3
* Partial RF of phase [25]:
- RF of loop [25:1]:
V2


### Specialization of cost equations start/4
* CE 2 is refined into CE [37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]
* CE 6 is refined into CE [52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69]
* CE 3 is refined into CE [70,71,72,73,74,75,76,77,78,79,80,81]
* CE 4 is refined into CE [82,83,84,85,86,87]
* CE 5 is refined into CE [88,89,90,91,92,93,94,95,96,97,98]
* CE 7 is refined into CE [99,100,101,102,103,104,105]
* CE 8 is refined into CE [106,107,108,109]
* CE 9 is refined into CE [110,111]
* CE 10 is refined into CE [112,113]


### Cost equations --> "Loop" of start/4
* CEs [51] --> Loop 28
* CEs [65,66] --> Loop 29
* CEs [46,63,64,105] --> Loop 30
* CEs [59,60] --> Loop 31
* CEs [49] --> Loop 32
* CEs [47,48,50,67,68,69,104] --> Loop 33
* CEs [43,44,45,61,62,103] --> Loop 34
* CEs [40,55,101] --> Loop 35
* CEs [41,42,56,57,58,102] --> Loop 36
* CEs [38,39,53,54,99,100] --> Loop 37
* CEs [37,52,107,108,109,111,113] --> Loop 38
* CEs [70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,106,110,112] --> Loop 39

### Ranking functions of CR start(V,V1,V2,V3)

#### Partial ranking functions of CR start(V,V1,V2,V3)


Computing Bounds
=====================================

#### Cost of chains of add(V,V1,Out):
* Chain [[14],13]: 1*it(14)+1
Such that:it(14) =< -V1+Out

with precondition: [V+V1=Out,V>=1,V1>=0]

* Chain [13]: 1
with precondition: [V=0,V1=Out,V1>=0]


#### Cost of chains of gr(V,V1,Out):
* Chain [[17],16]: 1*it(17)+1
Such that:it(17) =< V

with precondition: [Out=0,V>=1,V1>=V]

* Chain [[17],15]: 1*it(17)+1
Such that:it(17) =< V1

with precondition: [Out=1,V1>=1,V>=V1+1]

* Chain [16]: 1
with precondition: [V=0,Out=0,V1>=0]

* Chain [15]: 1
with precondition: [V1=0,Out=1,V>=1]


#### Cost of chains of p(V,Out):
* Chain [19]: 1
with precondition: [V=0,Out=0]

* Chain [18]: 1
with precondition: [V=Out+1,V>=1]


#### Cost of chains of cond1(V,V1,V2,V3,Out):
* Chain [[25],27]: 8*it(25)+0
Such that:it(25) =< V2

with precondition: [V=1,V1=0,V3=0,Out=0,V2>=1]

* Chain [[25],26,27]: 8*it(25)+7
Such that:it(25) =< V2

with precondition: [V=1,V1=0,V3=0,Out=0,V2>=1]

* Chain [[23],27]: 8*it(23)+1*s(3)+0
Such that:it(23) =< V2-V3
aux(1) =< V3
s(3) =< it(23)*aux(1)

with precondition: [V=1,V1=0,Out=0,V3>=1,V2>=V3+1]

* Chain [[23],24,27]: 8*it(23)+1*s(3)+1*s(4)+8
Such that:it(23) =< V2-V3
aux(2) =< V3
s(4) =< aux(2)
s(3) =< it(23)*aux(2)

with precondition: [V=1,V1=0,Out=0,V3>=1,V2>=V3+1]

* Chain [[22],[25],27]: 6*it(22)+8*it(25)+1*s(7)+0
Such that:it(25) =< V2
aux(5) =< V1
it(22) =< aux(5)
s(7) =< it(22)*aux(5)

with precondition: [V=1,V3=0,Out=0,V1>=1,V2>=1]

* Chain [[22],[25],26,27]: 6*it(22)+8*it(25)+1*s(7)+7
Such that:it(25) =< V2
aux(6) =< V1
it(22) =< aux(6)
s(7) =< it(22)*aux(6)

with precondition: [V=1,V3=0,Out=0,V1>=1,V2>=1]

* Chain [[22],27]: 6*it(22)+1*s(7)+0
Such that:aux(7) =< V1
it(22) =< aux(7)
s(7) =< it(22)*aux(7)

with precondition: [V=1,V3=0,Out=0,V1>=1,V2>=0]

* Chain [[22],26,27]: 6*it(22)+1*s(7)+7
Such that:aux(8) =< V1
it(22) =< aux(8)
s(7) =< it(22)*aux(8)

with precondition: [V=1,V2=0,V3=0,Out=0,V1>=1]

* Chain [[20],[23],27]: 6*it(20)+8*it(23)+1*s(3)+1*s(12)+1*s(13)+0
Such that:it(23) =< V2-V3
aux(12) =< V1
aux(13) =< V3
it(20) =< aux(12)
s(3) =< it(23)*aux(13)
s(13) =< it(20)*aux(13)
s(12) =< it(20)*aux(12)

with precondition: [V=1,Out=0,V1>=1,V3>=1,V2>=V3+1]

* Chain [[20],[23],24,27]: 6*it(20)+8*it(23)+1*s(3)+1*s(4)+1*s(12)+1*s(13)+8
Such that:it(23) =< V2-V3
aux(14) =< V1
aux(15) =< V3
it(20) =< aux(14)
s(4) =< aux(15)
s(3) =< it(23)*aux(15)
s(13) =< it(20)*aux(15)
s(12) =< it(20)*aux(14)

with precondition: [V=1,Out=0,V1>=1,V3>=1,V2>=V3+1]

* Chain [[20],27]: 6*it(20)+1*s(12)+1*s(13)+0
Such that:aux(11) =< V1
it(20) =< V1+V2-V3
aux(10) =< V3
it(20) =< aux(11)
s(13) =< it(20)*aux(10)
s(12) =< it(20)*aux(11)

with precondition: [V=1,Out=0,V1>=1,V2>=0,V3>=1,V1+V2>=V3+1]

* Chain [[20],24,27]: 6*it(20)+1*s(4)+1*s(12)+1*s(13)+8
Such that:aux(16) =< V1
aux(17) =< V3
it(20) =< aux(16)
s(4) =< aux(17)
s(13) =< it(20)*aux(17)
s(12) =< it(20)*aux(16)

with precondition: [V=1,Out=0,V2=V3,V1>=1,V2>=1]

* Chain [[20],21,27]: 6*it(20)+1*s(12)+1*s(13)+1*s(14)+1*s(15)+6
Such that:aux(11) =< V1
it(20) =< V1+V2-V3
s(14) =< -V2+V3
aux(18) =< V3
s(15) =< aux(18)
it(20) =< aux(11)
s(13) =< it(20)*aux(18)
s(12) =< it(20)*aux(11)

with precondition: [V=1,Out=0,V2>=0,V3>=V2+1,V1+V2>=V3+1]

* Chain [27]: 0
with precondition: [Out=0,V>=0,V1>=0,V2>=0,V3>=0]

* Chain [26,27]: 7
with precondition: [V=1,V1=0,V2=0,Out=0,V3>=0]

* Chain [24,27]: 1*s(4)+8
Such that:s(4) =< V2

with precondition: [V=1,V1=0,Out=0,V2>=1,V3>=V2]

* Chain [21,27]: 1*s(14)+1*s(15)+6
Such that:s(14) =< V1
s(15) =< V1+V2

with precondition: [V=1,Out=0,V1>=1,V2>=0,V3>=V1+V2]


#### Cost of chains of start(V,V1,V2,V3):
* Chain [39]: 66*s(73)+26*s(75)+64*s(81)+8*s(83)+142*s(84)+21*s(90)+2*s(92)+3*s(97)+24*s(102)+4*s(105)+4*s(106)+9*s(108)+12*s(133)+16*s(134)+2*s(136)+2*s(137)+2*s(141)+1*s(165)+14
Such that:s(130) =< V1-V3
s(165) =< -V2+V3
s(131) =< -V3
aux(43) =< V1
aux(44) =< V1+V2
aux(45) =< V1+V2-V3
aux(46) =< -V2+V3+1
aux(47) =< V2
aux(48) =< V2-V3
aux(49) =< V3
s(84) =< aux(43)
s(92) =< aux(44)
s(97) =< aux(46)
s(73) =< aux(47)
s(75) =< aux(49)
s(90) =< s(84)*aux(43)
s(102) =< aux(45)
s(81) =< aux(48)
s(102) =< aux(43)
s(105) =< s(102)*aux(49)
s(106) =< s(102)*aux(43)
s(108) =< s(84)*aux(49)
s(83) =< s(81)*aux(49)
s(133) =< s(130)
s(134) =< s(131)
s(133) =< aux(43)
s(136) =< s(133)*aux(49)
s(137) =< s(133)*aux(43)
s(141) =< s(134)*aux(49)

with precondition: [V=0]

* Chain [38]: 2*s(179)+1*s(180)+11
Such that:s(180) =< V1
aux(50) =< V
s(179) =< aux(50)

with precondition: [V>=1]

* Chain [37]: 48*s(183)+11
Such that:aux(51) =< V2
s(183) =< aux(51)

with precondition: [V>=0,V1>=0,V2>=0,V3>=0]

* Chain [36]: 9*s(188)+48*s(192)+6*s(194)+12
Such that:aux(55) =< V2-V3
aux(56) =< V3
s(188) =< aux(56)
s(192) =< aux(55)
s(194) =< s(192)*aux(56)

with precondition: [V=1,V1=0,V3>=1,V2>=V3+1]

* Chain [35]: 3*s(209)+11
Such that:aux(57) =< V2
s(209) =< aux(57)

with precondition: [V=1,V1=0,V2>=1,V3>=V2]

* Chain [34]: 76*s(212)+1*s(213)+64*s(215)+12*s(221)+11
Such that:s(213) =< 1
aux(60) =< V1
aux(61) =< V2
s(212) =< aux(60)
s(215) =< aux(61)
s(221) =< s(212)*aux(60)

with precondition: [V=1,V3=0,V1>=1,V2>=0]

* Chain [33]: 58*s(234)+17*s(235)+1*s(236)+2*s(241)+36*s(246)+48*s(247)+6*s(249)+6*s(250)+9*s(252)+9*s(253)+6*s(254)+3*s(259)+12
Such that:s(236) =< 1
aux(69) =< V1
aux(70) =< V1+V2-V3
aux(71) =< -V2+V3
aux(72) =< -V2+V3+1
aux(73) =< V2-V3
aux(74) =< V3
s(234) =< aux(69)
s(241) =< aux(71)
s(259) =< aux(72)
s(235) =< aux(74)
s(246) =< aux(70)
s(247) =< aux(73)
s(246) =< aux(69)
s(249) =< s(246)*aux(74)
s(250) =< s(246)*aux(69)
s(252) =< s(234)*aux(74)
s(253) =< s(234)*aux(69)
s(254) =< s(247)*aux(74)

with precondition: [V=1,V1>=1,V2>=0,V3>=1,V1+V2>=V3+1]

* Chain [32]: 1*s(291)+2*s(292)+16*s(295)+2*s(297)+12
Such that:s(291) =< 1
s(293) =< V2-V3
aux(75) =< V3
s(292) =< aux(75)
s(295) =< s(293)
s(297) =< s(295)*aux(75)

with precondition: [V=1,V1=1,V3>=1,V2>=V3+1]

* Chain [31]: 26*s(298)+4*s(304)+11
Such that:aux(77) =< V1
s(298) =< aux(77)
s(304) =< s(298)*aux(77)

with precondition: [V=1,V2=0,V3=0,V1>=1]

* Chain [30]: 5*s(305)+3*s(306)+11
Such that:aux(79) =< V1
aux(80) =< V1+V2
s(305) =< aux(79)
s(306) =< aux(80)

with precondition: [V=1,V1>=1,V2>=0,V3>=V1+V2]

* Chain [29]: 20*s(313)+6*s(314)+12*s(322)+16*s(323)+2*s(325)+2*s(326)+3*s(328)+3*s(329)+2*s(330)+12
Such that:s(319) =< V1-V3
s(320) =< -V3
aux(83) =< V1
aux(84) =< V3
s(313) =< aux(83)
s(314) =< aux(84)
s(322) =< s(319)
s(323) =< s(320)
s(322) =< aux(83)
s(325) =< s(322)*aux(84)
s(326) =< s(322)*aux(83)
s(328) =< s(313)*aux(84)
s(329) =< s(313)*aux(83)
s(330) =< s(323)*aux(84)

with precondition: [V=1,V2=0,V3>=1,V1>=V3+1]

* Chain [28]: 1*s(331)+2*s(332)+1*s(333)+10
Such that:s(333) =< -V2+V3
s(331) =< -V2+V3+1
aux(85) =< V3
s(332) =< aux(85)

with precondition: [V=1,V1+V2=V3+1,V1>=2,V2>=0]


Closed-form bounds of start(V,V1,V2,V3):
-------------------------------------
* Chain [39] with precondition: [V=0]
- Upper bound: nat(V1)*142+14+nat(V1)*21*nat(V1)+nat(V1)*2*nat(V1-V3)+nat(V1)*4*nat(V1+V2-V3)+nat(V2)*66+nat(V3)*26+nat(V3)*9*nat(V1)+nat(V3)*2*nat(-V3)+nat(V3)*2*nat(V1-V3)+nat(V3)*8*nat(V2-V3)+nat(V3)*4*nat(V1+V2-V3)+nat(-V3)*16+nat(V1+V2)*2+nat(-V2+V3)+nat(-V2+V3+1)*3+nat(V1-V3)*12+nat(V2-V3)*64+nat(V1+V2-V3)*24
- Complexity: n^2
* Chain [38] with precondition: [V>=1]
- Upper bound: 2*V+11+nat(V1)
- Complexity: n
* Chain [37] with precondition: [V>=0,V1>=0,V2>=0,V3>=0]
- Upper bound: 48*V2+11
- Complexity: n
* Chain [36] with precondition: [V=1,V1=0,V3>=1,V2>=V3+1]
- Upper bound: 48*V2-48*V3+ (9*V3+12+ (V2-V3)* (6*V3))
- Complexity: n^2
* Chain [35] with precondition: [V=1,V1=0,V2>=1,V3>=V2]
- Upper bound: 3*V2+11
- Complexity: n
* Chain [34] with precondition: [V=1,V3=0,V1>=1,V2>=0]
- Upper bound: 76*V1+12+12*V1*V1+64*V2
- Complexity: n^2
* Chain [33] with precondition: [V=1,V1>=1,V2>=0,V3>=1,V1+V2>=V3+1]
- Upper bound: 36*V1+36*V2-36*V3+ (58*V1+13+9*V1*V1+ (V1+V2-V3)* (6*V1)+17*V3+9*V3*V1+6*V3*nat(V2-V3)+ (V1+V2-V3)* (6*V3)+nat(-V2+V3)*2+nat(-V2+V3+1)*3+nat(V2-V3)*48)
- Complexity: n^2
* Chain [32] with precondition: [V=1,V1=1,V3>=1,V2>=V3+1]
- Upper bound: 16*V2-16*V3+ (2*V3+13+ (V2-V3)* (2*V3))
- Complexity: n^2
* Chain [31] with precondition: [V=1,V2=0,V3=0,V1>=1]
- Upper bound: 26*V1+11+4*V1*V1
- Complexity: n^2
* Chain [30] with precondition: [V=1,V1>=1,V2>=0,V3>=V1+V2]
- Upper bound: 8*V1+3*V2+11
- Complexity: n
* Chain [29] with precondition: [V=1,V2=0,V3>=1,V1>=V3+1]
- Upper bound: 12*V1-12*V3+ (20*V1+12+3*V1*V1+ (V1-V3)* (2*V1)+6*V3+3*V3*V1+ (V1-V3)* (2*V3))
- Complexity: n^2
* Chain [28] with precondition: [V=1,V1+V2=V3+1,V1>=2,V2>=0]
- Upper bound: -2*V2+4*V3+11
- Complexity: n

### Maximum cost of start(V,V1,V2,V3): max([max([nat(V2)*48+1,nat(V3)*2+max([nat(-V2+V3+1)+nat(-V2+V3),nat(V3)*2*nat(V2-V3)+2+nat(V2-V3)*16+max([1,nat(V3)*4*nat(V2-V3)+nat(V3)*7+nat(V2-V3)*32])])]),nat(V1)+1+max([2*V,nat(V1)*4+max([nat(V1+V2)*3,nat(V1)*3*nat(V1)+nat(V1)*15+max([nat(V1)*32+1+nat(V1)*5*nat(V1)+max([nat(V1)*6*nat(V1+V2-V3)+1+nat(V3)*17+nat(V3)*9*nat(V1)+nat(V3)*6*nat(V2-V3)+nat(V3)*6*nat(V1+V2-V3)+nat(-V2+V3)*2+nat(-V2+V3+1)*3+nat(V2-V3)*48+nat(V1+V2-V3)*36,nat(V1)*66+2+nat(V1)*9*nat(V1)+nat(V1)*2*nat(V1-V3)+nat(V1)*4*nat(V1+V2-V3)+nat(V2)*2+nat(V3)*26+nat(V3)*9*nat(V1)+nat(V3)*2*nat(-V3)+nat(V3)*2*nat(V1-V3)+nat(V3)*8*nat(V2-V3)+nat(V3)*4*nat(V1+V2-V3)+nat(-V3)*16+nat(V1+V2)*2+nat(-V2+V3)+nat(-V2+V3+1)*3+nat(V1-V3)*12+nat(V2-V3)*64+nat(V1+V2-V3)*24+ (nat(V1)*3*nat(V1)+nat(V1)*18+nat(V2)*64)])+ (nat(V1)*nat(V1)+nat(V1)*6),nat(V1)*2*nat(V1-V3)+1+nat(V3)*6+nat(V3)*3*nat(V1)+nat(V3)*2*nat(V1-V3)+nat(V1-V3)*12])])])])+10
Asymptotic class: n^2
* Total analysis performed in 1583 ms.

(10) BOUNDS(1, n^2)